 package com.gmrz.uaf.protocol.v1.processor;
 
 import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.name.Named;
import com.gmrz.uaf.common.Constants;
import com.gmrz.uaf.protocol.v1.schema.OperationHeader;
import com.gmrz.uaf.protocol.v1.schema.ServerData;
import com.gmrz.uaf.protocol.v1.schema.Version;

 public class AuthOpHeaderProvider
   implements Provider<OperationHeader>
 {
   private String appID = null;
   private Version protocolVersion = new Version();
 
   @Inject
   private void setApplicationID(@Named("uaf.application.id") String appID)
   {
     this.appID = appID;
   }
 
   public OperationHeader get()
   {
     ServerData serverData = new ServerData();
     serverData.setOperationId((byte)Constants.Operation.AUTH.getID());
     serverData.setTimestamp(System.currentTimeMillis());
 
     return new OperationHeader().withApplicationID(this.appID).withOperation(Constants.Operation.AUTH).withProtocolVersion(this.protocolVersion).withServerData(serverData);
   }
 }
